package com.nickmao.stumgr.android;

import java.util.List;

import com.nickmao.stumgr.android.adapter.StudentListAdapter;
import com.nickmao.stumgr.android.db.StudentDatabaseHelper;
import com.nickmao.stumgr.android.po.Student;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

public class StudentListActivity extends Activity {
    
	private ListView lstView = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.stulist);
		lstView = (ListView)findViewById(R.id.lststu);
		StudentDatabaseHelper dbHelper = new StudentDatabaseHelper(this);
		List<Student> stuList  = dbHelper.getStudents();
		StudentListAdapter adapter = new StudentListAdapter(this, stuList);
		lstView.setAdapter(adapter);
	}

}
